#include <stdio.h>
#include <stdlib.h>
#include <signal.h>

int main(int argc, char **argv)
{
    union sigval sig_val;
    int pid;
    int sig;

    if(3 > argc)
        exit(-1);

    pid = atoi(argv[1]);
    sig = atoi(argv[2]);
    printf("pid: %d, signal: %d\n", pid, sig);

    sig_val.sival_int = 10;
    if(-1 == sigqueue(pid, sig, sig_val)){
        perror("sigqueue error");
        exit(-1);
    }

    puts("Signal send success!\n");
    
    exit(0);
}